﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RoommateManagementSystem
{
    public partial class FrmMain : Form
    {
        
        #region Properties/Members

        private CreateNewTransaction.UcCreateNewTransaction ucCreateNewTransaction;

        public CreateNewTransaction.UcCreateNewTransaction UcCreateNewTransaction
        {
            get
            {
                if (ucCreateNewTransaction == null)
                {
                    ucCreateNewTransaction = new CreateNewTransaction.UcCreateNewTransaction();
                    this.Controls.Add(UcCreateNewTransaction);
                    ucCreateNewTransaction.Dock = System.Windows.Forms.DockStyle.Fill;
                    ucCreateNewTransaction.Visible = true;
                    
                    
                }
                return ucCreateNewTransaction;
            }
        }

        private PendingTransactions.UcPendingTransactions ucPendingTransactions;

        public PendingTransactions.UcPendingTransactions UcPendingTransactions
        {
            get
            {
                if (ucPendingTransactions == null)
                {
                    ucPendingTransactions = new PendingTransactions.UcPendingTransactions();
                    this.Controls.Add(UcPendingTransactions);
                    ucPendingTransactions.Dock = System.Windows.Forms.DockStyle.Fill;
                    ucPendingTransactions.Visible = true;
                }
                return ucPendingTransactions;
            }
        }

        private ViewTransactionHistory.UcViewTransactionHistory ucViewTransactionHistory;

        public ViewTransactionHistory.UcViewTransactionHistory UcViewTransactionHistory
        {
            get
            {
                if (ucViewTransactionHistory == null)
                {
                    ucViewTransactionHistory = new ViewTransactionHistory.UcViewTransactionHistory();
                    this.Controls.Add(UcViewTransactionHistory);
                    ucViewTransactionHistory.Dock = System.Windows.Forms.DockStyle.Fill;
                    ucViewTransactionHistory.Visible = true;
                }
                return ucViewTransactionHistory;
            }
        }

        #endregion


        public FrmMain()
        {
            InitializeComponent();

        }


        public static void Main(String[] args)
        {
            Application.Run(new FrmMain());
        }

        private void toolStripButtonViewPendingTransactions_Click(object sender, EventArgs e)
        {
            UcPendingTransactions.BringToFront();
        }

        private void toolStripButtonViewTransactionHistory_Click(object sender, EventArgs e)
        {
            
            UcViewTransactionHistory.BringToFront();
        }

        private void toolStripButtonCreateNewTransaction_Click(object sender, EventArgs e)
        {
            UcCreateNewTransaction.BringToFront();
        }
    }
}
